def function(x):
    y = 0
    if x < 0:
        y = x ** 2
    if x >= 0 and x < 2:
        y = 2 * x + 3
    if x >= 2:
        y = x ** 0.5
    return y

print(function(3))
print(function(-1.5))

def function(x):
    y = 0
    if x < 0:
        y = x ** 2
    elif x >= 0 and x < 2:
        y = 2 * x + 3
    else:
        y = x ** 0.5
    return y

print(function(3))
print(function(-1.5))


import math
def function(x):
    if x < 0:
        return x ** 2
    elif x >= 0 and x < 2:
        return 2 * x + 3
    else:
        return math.sqrt(x)

print(function(3))
print(function(-1.5))